<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //1、
    var s1='get-element-by-id'
    var a=s1.split('-')
    var b= a[1].replace('e','E')
    var bb= a[2].replace('b','B')
    var c= a[3].replace('i','I')
    var d=a[0]+b+bb+c
    console.log(d);
    //2、
    var s2='tryuwuensfdacuhsvdbshdifvbiuawefawefwcvgbhjnkf'
    var brr={}
    
    for( var i=0;i<s2.length;i++){
        var aa=s2[i]
        if(brr[aa]){ 
            brr[aa]++
        }else{
            brr[aa]=1
        }
    }
    console.log(brr);
</script>